package translinkApp.Data.Utils;

public class ParseAddress {

	public static String modifyAddress(String address) {

		// int lastIntegerIndex;
		// lastIntegerIndex = findLastIntegerIndex(address);
		// address = address.substring(lastIntegerIndex + 1);
		address = address.trim();

		address = replaceAcronyms(address);

		return address;
	}

	public static String replaceAcronyms(String streetName) {
		streetName = streetName.replace(" Rd ", " Road ");
		streetName = streetName.replace(" Ct ", " Court ");
		streetName = streetName.replace(" St ", " Street ");
		return streetName.replace(" Dr ", " Drive ");
	}

	// private static int findLastIntegerIndex(String searchString) {
	// int index = -1;
	//
	// int charIndex = 0;
	// for (Character chara : searchString.toCharArray()) {
	//
	// if (Character.isDigit(chara))
	// index = charIndex;
	//
	// charIndex++;
	// }
	//
	// return index;
	// }

}
